using NUnit.Framework.ExtensionsImpl;

namespace NUnit.Framework
{
	public static class StringConstraintsExtensions
	{
		public static IAndConstraints<IStringConstraints> SameInstanceAs(this IStringBeConstraints constraint, string expected)
		{
			constraint.AssertionInfo.AssertUsing(Is.SameAs(expected));
			return ConstraintsHelper.AndChain(constraint.AssertionParent);
		}

		public static IAndConstraints<IStringConstraints> Contain(this IStringConstraints constraint, string expected)
		{
			constraint.AssertionInfo.AssertUsing(Text.Contains(expected));
			return ConstraintsHelper.AndChain(constraint);
		}

		public static IAndConstraints<IStringConstraints> StartWith(this IStringConstraints constraint, string expected)
		{
			constraint.AssertionInfo.AssertUsing(Text.StartsWith(expected));
			return ConstraintsHelper.AndChain(constraint);
		}

		public static IAndConstraints<IStringConstraints> EndWith(this IStringConstraints constraint, string expected)
		{
			constraint.AssertionInfo.AssertUsing(Text.EndsWith(expected));
			return ConstraintsHelper.AndChain(constraint);
		}

		public static IAndConstraints<IStringConstraints> Match(this IStringConstraints constraint, string expected)
		{
			constraint.AssertionInfo.AssertUsing(Text.Matches(expected));
			return ConstraintsHelper.AndChain(constraint);
		}
	}
}